package com.java.chainofresponsibility;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author: TongRui乀
 * @Date: 2019/3/6 14:27
 * @description：
 */
@Slf4j
public class PlayerC extends Player {

    public PlayerC(Player player){
        super.setNext(player);
    }

    @Override
    public void handler(int index) {
        if(index == 3){
            log.info("C 唱歌");
        }else{
            log.info("C 向下传");
            next(index + 1);
        }
    }
}
